JvmBigInt

Constructors

Link copied to clipboard
constructor(value: BigInteger)
constructor(value: Int)
constructor(value: Long)
constructor(value: String, radix: Int)

Types

Link copied to clipboard

Properties

Link copied to clipboard

Determines if this BigInt is negative

Link copied to clipboard

Determines if this BigInt is either negative or zero (non-positive)

Link copied to clipboard
open val isNotZero: Boolean

Determines if this BigInt is not 0

Link copied to clipboard

Determines if this BigInt is positive

Link copied to clipboard

Determines if this BigInt is either positive or zero (non-negative)

Link copied to clipboard
open val isZero: Boolean

Determines if this BigInt is 0

Link copied to clipboard
Link copied to clipboard
open override val signum: Int

Returns -1, 0 or +1 depending on the sign of this BigInt

Link copied to clipboard

Functions

Link copied to clipboard
open override fun abs(): BigInt

Returns this BigInt as positive or zero. Equivalent to if (isNegative) -this else this

Link copied to clipboard
open infix override fun and(other: BigInt): BigInt

Returns a new BigInt with bits combining this, other doing a bitwise &/and operation. Forces sign to positive.

Link copied to clipboard
open operator override fun compareTo(other: BigInt): Int
Link copied to clipboard
open override fun create(value: Int): BigInt
open override fun create(value: Long): BigInt
open override fun create(value: String): BigInt
open override fun create(value: String, radix: Int): BigInt
Link copied to clipboard
open operator fun div(other: Int): BigInt

Returns this / other

open operator override fun div(other: BigInt): BigInt

Returns a new BigInt this this / other

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun inv(): BigInt

Returns a new BigInt with its bits flipped. 0 converts into 1, and 1 into 0. Equivalent to -(this + 1)

Link copied to clipboard
open operator fun minus(other: Int): BigInt

Returns this - other

open operator override fun minus(other: BigInt): BigInt

Returns a new BigInt this this - other

Link copied to clipboard
open infix override fun or(other: BigInt): BigInt

Returns a new BigInt with bits combining this, other doing a bitwise |/or operation. Forces sign to positive.

Link copied to clipboard
open operator fun plus(other: Int): BigInt

Returns this + other

open operator override fun plus(other: BigInt): BigInt

Returns a new BigInt this this + other

Link copied to clipboard
open infix override fun pow(exponent: BigInt): BigInt
open infix override fun pow(exponent: Int): BigInt

Returns this BigInt raised to exponent : this ** exponent

Link copied to clipboard
open operator fun rangeTo(that: BigInt): BigIntRange

Creates a new inclusive BigIntRange ranging from this to that

Link copied to clipboard
open operator fun rem(other: Int): BigInt

Returns this % other

open operator override fun rem(other: BigInt): BigInt

Returns a new BigInt this this % other

Link copied to clipboard
open infix override fun shl(count: Int): BigInt

Returns a new BigInt with bits from this shifted to the left count. Equivalent to multiply by 2**count. Keeps the sign of this

Link copied to clipboard
open infix override fun shr(count: Int): BigInt

Returns a new BigInt with bits from this shifted to the left count. Equivalent to divide by 2**count. Keeps the sign of this

Link copied to clipboard
open override fun square(): BigInt

Square of this number. Equivalent this * this, but might be faster in some implementations.

Link copied to clipboard
open operator fun times(other: Int): BigInt
open operator fun times(other: Long): BigInt

Returns this * other

open operator override fun times(other: BigInt): BigInt

Returns a new BigInt this this * other

Link copied to clipboard
Link copied to clipboard
open override fun toInt(): Int

Converts this number to a Int. Throws a BigIntOverflowException in the case the number is too big to be stored in an Int

Link copied to clipboard
open override fun toString(): String

open override fun toString(radix: Int): String

Converts this number to a String using the specified radix. The radix is the base to use. 10 for decimal. 16 for hexadecimal.

Link copied to clipboard
open operator override fun unaryMinus(): BigInt

Returns a new BigInt with its sign changed. In the case of 0, it returns itself.

Link copied to clipboard
open operator override fun unaryPlus(): BigInt

Returns this BigInt. A convenience method to make explicit the sign and to have symmetry with unaryMinus.

Link copied to clipboard
open infix override fun xor(other: BigInt): BigInt

Returns a new BigInt with bits combining this, other doing a bitwise ^/xor operation. Forces sign to positive.